docs.nanobananaapi.ai
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
NanoBanana API
Common API
NanoBanana API
Common API
  1. NanoBanana API
  • Welcome to NanoBanana API
  • NanoBanana API Quickstart
  • Image Generation or Editing Callbacks
  • Generate Image Callbacks (Nanobanana 2)
  • Generate Image (Pro) Callbacks
  • Generate or Edit Image
    POST
  • Generate Image (Nanobanana 2)
    POST
  • Generate Image (Pro)
    POST
  • Get Task Details
    GET
  1. NanoBanana API

NanoBanana API Quickstart

Get started with the NanoBanana API in minutes. Learn how to generate and edit images using AI.

Welcome to the NanoBanana API!#

This quickstart guide will walk you through the essential steps to start generating and editing images using our AI models.

Overview#

Generate Images
Create AI images from text descriptions or edit existing images
Task Details
Query task status and get generated image results

Authentication#

All API requests require authentication via Bearer Token.
1
Get Your API Key
Visit the API Key Management Page to obtain your API key.
2
Add to Request Headers
Include your API key in all requests:
Keep your API key secure and never share it publicly. If compromised, reset it immediately in the management page.

Basic Usage#

1. Generate an Image#

Start by creating your first image generation task:
cURL
Node.js
Python
Response:
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task12345"
  }
}

2. Check Task Status#

Use the returned taskId to monitor progress:
cURL
Node.js
Python
Status Values:
0: GENERATING - Task is currently being processed
1: SUCCESS - Task completed successfully
2: CREATE_TASK_FAILED - Failed to create the task
3: GENERATE_FAILED - Task creation succeeded but generation failed

Complete Example#

Here's a complete workflow example:
JavaScript
Python

Parameters#

Required Parameters#

ParameterTypeDescription
promptstringText description for image generation
typestringGeneration type: TEXTTOIAMGE or IMAGETOIAMGE
callBackUrlstringWebhook callback URL

Optional Parameters#

ParameterTypeDescriptionDefault
numImagesintegerNumber of images to generate (1-4)1
imageUrlsarrayInput image URLs for editing-
watermarkstringWatermark text for generated images-

Next Steps#

Generate Images
Learn about all generation parameters and advanced options
Check Account Credits
Monitor your account credit balance

Support#

Need help? Contact our technical support:
Technical Support: support@nanobanana.com
Ready to create amazing AI images? Start with the examples above and explore the full API capabilities!
Modified at 2026-11-11 03:43:02
Previous
Welcome to NanoBanana API
Next
Image Generation or Editing Callbacks
Built with